home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / grafik / raytracing / rayshade-4.0.6.3 / enhance / fractals.doc < prev    next >
Text File  |  1994-08-09  |  8KB  |  192 lines

  1. Raytracing fractals with rayshade:
  2.  
  3. The file rayshade.4.0.6-fractals.tar contains additions and modifications to 
  4. the rayshade.4.0.6 distribution that will enable you to raytrace fractals, more
  5. specifically:
  6.  
  7. - fractal mountains ala [Musgrave et al, 1989]
  8. - general random midpoint subdivision objects ala [Magnenat-Thalmann et al,
  9.     1987]
  10. - 3D Iterated Function Systems ala [Barnsley, 1988]
  11. - 3D Iterated Function Systems with condensation set 
  12. - 3D Hierarchical Iterated Function Systems 
  13. - Oppenheimer trees ala [Oppenheimer, 1986]
  14.  
  15. This code is tha result of two graduation theses at
  16. the K.U.Leuven, Leuven, Belgium during the academic year 1992-1993. 
  17. It is offered to anyone who'd like to use it on an as-is basis and 
  18. will probably not be supported by us in future. Use it as you like, 
  19. modify it as you like, but don't complain that it doesn't fit your 
  20. particular purposes. At least the example rayshade scripts in this 
  21. package have been tested and the code worked for these on a variety 
  22. of machines. 
  23.  
  24. ----
  25.  
  26. Installation:
  27.  
  28. The rayshade.4.0.6-fractals.tar file unpacks in the rayshade.4.0.6 
  29. directory, as does rayshade.4.0.6.tar. 'cd' to rayshade.4.0 and
  30. execute 'sh install-patches' and then, if you ran the Configure script
  31. before, run Reconfigure, and if you didn't, execute that
  32. one (Configure).
  33.  
  34. After making it, test your new rayshade on crazy.ray, ferns.ray,
  35. fractalballs.ray, moon.ray, pyramids.ray, shirt.ray and/or tree.ray 
  36. in the Examples subdirectory of rayshade.4.0. I tested the patches
  37. on various machines (IBM RS/6000, Sun 4, Dec 3100, IBM PC running Linux)
  38. and had no problems on these. Anyway, I don't see anything too bizarre in
  39. the code that might break any more or less standard C compiler too
  40. seriously.
  41.  
  42. Don't expect your computer to be ready soon: these are very
  43. complicated objects and some of them require long preprocessing times.
  44. Giving rayshade the -S1 and -D1 switches and/or reducing the screen size
  45. will make it render quite a bit faster (with equally lower image quality).
  46.  
  47. ---
  48.  
  49. Fractal object rayshade-format:
  50.  
  51. (parts between '...' are litteral, parts between [...] optional)
  52.  
  53.  
  54. 1) fractal mountains:
  55.  
  56. 'mountain' [surface] x1 x2 y1 y2
  57.                    r
  58.                    H
  59.                    precalculation-level
  60.                    max-calculation-level
  61.            scale-factor
  62.                    z1 ... zn
  63.  
  64. with
  65.  
  66. - surface: a name for a rayshade surface description 
  67. - x1 x2 y1 y2: coordinates of the mountains base plane
  68. - r: a random seed number
  69. - H: for a fractal dimension D = 3-H, eg 0.8 for D=2.2 (looks nice)
  70. - precalculation-level: the level to which the mountain has to be
  71.     precalculated, that is, worked out before starting the raytracing
  72.      itself. The higher this number, the faster the raytracing, but
  73.     the more memory is needed.
  74. - max-calculation-level: to which recursion level the mountain has to be
  75.     calculated: precalculation-level <= max-calculation-level
  76. - scale-factor: a scale factor to be applied to all random displacements
  77.     (controls the raggedness of the mountain)
  78. - z1 ... zn: a square matrix of initial height values. 
  79.  
  80. See rayshade.4.0/Example/mountain.ray for an example and [Musgrave et all, 
  81. 1989] for details.
  82.  
  83.  
  84. 2) general random midpoint displacement objects:
  85.  
  86. 'fractalobject' [surface] r dim max excentricity
  87.             'fpoints' x1 y1 z1 ... xn yn zn
  88.             'ftriangles' p11 p12 p13 ... pm1 pm2 pm3
  89.             'fentities'
  90.                   'fentity' dx dy dz t1 ... tk 
  91.                   ... 
  92.                   'fentity' dx dy dz t1 ... tk 
  93.  
  94. with
  95.  
  96. - r: a random seed number
  97. - dim: fractal dimension
  98. - max: maximum length of a side of a triangle
  99. - excentricity: scalefactor by which all random displacements are multiplied
  100. - fpoints: followed by a list of triangle vertices
  101. - ftriangle: followed by a list of triangles describing the object to
  102.     be deformed. each triangle is given by the indices of three
  103.     points in the list of vertices
  104. - fentities: starts a list of subobject-descriptions. Dividing an object in
  105.     subobjects speeds up the rendering.
  106. - fentity: starts the description of a subobject
  107. - dx dy dz: in how many parts the bounding box of the subobject has to be
  108.     split.
  109. - t1 ... tk: a list of triangles (given by index in the triangle list) that
  110.     belong to this subobject.
  111.  
  112. More information can be found in [Magnenat-Thalmann et al, 1987]. crazy.ray
  113. and shirt.ray are example scripts for this class of objects.
  114.  
  115.  
  116. 3) Iterated Function Systems
  117.  
  118. 'ifs' [condensation-set','] [leaf','] IFS-transformations [options] 'end'
  119.  
  120. with
  121.  
  122. - condensation-set: for an IFS with condensation set or Oppenheimer tree: can
  123.     be any object that rayshade accepts for rendering (including another
  124.     IFS or Oppenheimer tree ...)
  125. - leaf: for an Oppenheimer tree the condensation set describes the geometry
  126.     of a branch and this rayshade object describes the geometry for
  127.     a leaf. Can also be any object rayshade can render.
  128. - IFS-transformations: IFS-transformation [','IFS-transformations]
  129. - IFS-transformation: [priority] transformation
  130. - priority: rang of the transformation in a hierarchical IFS
  131. - transformation: a rayshade transformation or comsposition of transformations.
  132. - options:
  133.     - 'normalweighting' {'highpass'|'lowpass'|'constant'}: controls
  134.         the way normals are constructed on the attractor of a
  135.         plain IFS or HIFS without condensation ala [Hart and
  136.         Defanti, 1991]. Just try it out.
  137.     - 'maxdepth' depth: to which level of recursion the attractor of
  138.         an IFS has to be worked out
  139.     - 'minsize' size: don't go subdividing objects that are smaller than
  140.         this size (also controls the recursion depth, but adaptively).
  141.     - 'bounding' {'box'|'sphere'}: use a box or a sphere as bounding
  142.         volume. The code tries to choose the best one by
  143.         comparing the average projected area of the smallest
  144.         possible box and sphere. 
  145.     - 'list' filename: produce a list of volumes that will be
  146.         rendered in the file with given name. After some editing
  147.         this list can be used as input for rayshade for using 
  148.         a grid for faster rendering (in some cases it is just much
  149.         faster to give rayshade a list of objects in a grid instead
  150.         of using the general ray-IFS intersection routines)
  151.  
  152. The implementation is based on [Hart and Defanti, 1991]. See
  153.  
  154. - pyramids.ray: for an example of a plain IFS
  155. - fractalballs.ray: Eric haines' sphereflake is an IFS with condensation set
  156. - ferns.ray: Barnsley's fern leaf is a hierarchical IFS
  157. - tree.ray: simple example of an Oppenheimer tree
  158.  
  159. ----
  160.  
  161. References:
  162.  
  163. - [Barnsley, 1988]  M. Barnsley, 'fractals everywhere', Academic Press inc., 
  164.     1988
  165. - [Hart and Defanti, 1991]  J. C. Hart and Th. Defanti, 'Efficient antialiased
  166.     raytracing of 3D linear fractals', Computer Graphics, 25(4):91, 
  167.     july 1991
  168. - [Magnenat-Thalmann et al, 1987]  N. Magnenat-Thalmann, L. Forest, M. Burges,
  169.     and D. Thalmann, 'A geometric study of parameters for recursive
  170.     midpoint subdivision', The Visual Computer, 3:145-151, 1987
  171. - [Musgrave et al, 1988]  F. K. Musgrave, C. E. Kolb(!), and R. S. Mace,
  172.     'The synthesis and rendering of eroded fractal terrains', Computer
  173.     Graphics, 23(3):41-50, 1989
  174. - [Oppenheimer, 1986]  P. E. Oppenheimer, 'real time desing and animation
  175.     of fractal plants and trees', Computer Graphics, 20(4):55-61, 1986
  176.  
  177. ----
  178.  
  179. The fractal mountains and general random midpoint subdivision objects
  180. were done by Peter Janssen, the IFS objects by Philippe Bekaert, in
  181. the computer graphics research group of the dpt. of computer science
  182. of the K.U.Leuven, Leuven, Belgium.
  183.  
  184. Send e-mail to
  185.  
  186.     philippe@cs.kuleuven.ac.be
  187.  
  188. for questions, bug-reports, comments ... although we do not intend to really
  189. support this code in future, as stated before.
  190.  
  191.  
  192.